This folder contains the data and code necessary to reproduce the tables and figures in
"Moderates" by Anthony Fowler, Seth Hill, Jeff Lewis, Chris Tausanovitch, Lynn Vavreck,
and Christopher Warshaw. Please contact Anthony Fowler (anthony.fowler@uchicago.edu) with
any questions.

"Measurement_Model.R" contains code necessary to reproduce our estimates of the one-dimensional ideology score and type (ie, Downsian, Conversian, inattentive) of survey respondents.
	- Note: This code takes a long time to run (~8 hours), and the final estimates are included in the replication archive. 
	- Code run under R version 3.5.2 with package versions as follows:
              - foreign 0.8.71
              - aroma.light 3.10.0
              - gtools 3.8.2
              - Rcpp 1.0.5
              - ggplot2 3.3.2
              - tidyverse 1.3.0
              - reldist 1.6.6
              - ggtern 3.3.0

"Analysis_Code.do" contains the Stata code necessary to reproduce Tables 3-4, Tables A6-A9, and
Figures 1-6, and Figure A6. All of these analyses were conducted using Stata 17.0. If you are using
an earlier version of Stata, you may have to reformat datasets for compatibility. We also note that
the syntax of the "table" command changed between Stata 16 and 17, so if you are using an earlier version
of Stata, you will also have to change those command. For example, "table source2 [aw = weight], statistic(mean w1 w2 w3)"
should be replaced with "table source2 [aw = weight], content(mean w1 mean w2 mean w3)" if you are using an earlier version.

"Table_2.R" contains R code (version 4.1.1) necessary to reproduce Table 2 in the manuscript. 
	- Code run under R version 4.1.1 with package versions as follows:
         - tidyverse 1.3.1
         - survey 4.1-1
         - xtable 1.8-4
         - haven 2.4.3
         - foreign 0.8-82

To replicate the analyses in our appendices:
	- Appendix A: No analyses in this appendix. This is just the model description.
	- Appendix B: Run appendix B/simulate_cces_2014_test.R and appendix B/simulate_cces_2014_alt.R
	- Appendix C: See appendix C/README.txt
	- Appendix D: See appendix D/README.txt
	- Appendix E: These are generated in Analysis_Code.do
	- Appendix F: These are generated in Analysis_Code.do
	- Appendix G: Run appendix G/appendix_G.R

Below is a brief summary of each data file used in these analyses:
	- bigsurveys_recoded4.dta: individual-level estimates for CCES respondents from 2012-2020
	- module2010_plus_estimates.dta: individual-level estimates for the 2010 module
	- CCES_2014_modules_extreme_responses.dta: data from the 2014 modules used to create Figure 3
	- CCES_Contextual_Cleaned: individual-level estimates combined with U.S. House voting behavior from 2012-2018
	- CCES16_Common_OUTPUT_Feb2018_VV.dta: CCES 2016 common content
	- The folder CCES Questions contains information about how each CCES question was recoded and consolidated to create the pooled survey (bigsurveys_recoded4.dta)
